package com.unismc.charge.collector.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestControllerAdvice;


@Slf4j
@RestControllerAdvice
public class ExceptionAdvice {

    //@ExceptionHandler(SignVerifyFailureException.class)
    //public Result<?> handleSignVerifyFailureException(SignVerifyFailureException e) {
    //    log.error("SignVerifyFailureException", e);
    //    Result result = new Result();
    //    result.setRet(4001);
    //    result.setMsg("签名校验失败");
    //    return result.encryptAndSign(
    //        chargeProperties.getOperatorId(),
    //        chargeProperties.getDataSecretIV(),
    //        chargeProperties.getDataSecret(),
    //        chargeProperties.getSigSecret(),
    //        o -> o
    //    );
    //}

//    @ExceptionHandler(QueryTokenFailureException.class)
//    public Result<?> handleQueryTokenFailureException(QueryTokenFailureException e) {
//        log.error("QueryTokenFailureException", e);
//        Result result = new Result();
//        result.setRet(4001);
//        result.setMsg("签名校验失败");
//        return result.encryptAndSign(
//            chargeProperties.getOperatorId(),
//            chargeProperties.getDataSecretIV(),
//            chargeProperties.getDataSecret(),
//            chargeProperties.getSigSecret(),
//            o -> o
//        );
//    }
//
//    @ExceptionHandler(RequestFailureException.class)
//    public Result<?> handleRequestFailureException(RequestFailureException e) {
//        log.error("RequestFailureException", e);
//        Result result = new Result();
//        result.setRet(4001);
//        result.setMsg("签名校验失败");
//        return result.encryptAndSign(
//            chargeProperties.getOperatorId(),
//            chargeProperties.getDataSecretIV(),
//            chargeProperties.getDataSecret(),
//            chargeProperties.getSigSecret(),
//            o -> o
//        );
//    }
}
